3.51 \(\int \frac{1-x+3 x^2}{1-x^3} \, dx\)

Optimal. Leaf size=30 \[ \frac{2 \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}}-\log \left (1-x^3\right ) \]

[Out]

(2*ArcTan[(1 + 2*x)/Sqrt[3]])/Sqrt[3] - Log[1 - x^3]

_______________________________________________________________________________________

Rubi [A]  time = 0.0569621, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25 \[ \frac{2 \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}}-\log \left (1-x^3\right ) \]

Antiderivative was successfully verified.

[In]  Int[(1 - x + 3*x^2)/(1 - x^3),x]

[Out]

(2*ArcTan[(1 + 2*x)/Sqrt[3]])/Sqrt[3] - Log[1 - x^3]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 12.4202, size = 34, normalized size = 1.13 \[ - \log{\left (\left (x - 1\right ) \left (x^{2} + x + 1\right ) \right )} + \frac{2 \sqrt{3} \operatorname{atan}{\left (\sqrt{3} \left (\frac{2 x}{3} + \frac{1}{3}\right ) \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((3*x**2-x+1)/(-x**3+1),x)

[Out]

-log((x - 1)*(x**2 + x + 1)) + 2*sqrt(3)*atan(sqrt(3)*(2*x/3 + 1/3))/3

_______________________________________________________________________________________

Mathematica [A]  time = 0.0153144, size = 30, normalized size = 1. \[ \frac{2 \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{\sqrt{3}}-\log \left (1-x^3\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[(1 - x + 3*x^2)/(1 - x^3),x]

[Out]

(2*ArcTan[(1 + 2*x)/Sqrt[3]])/Sqrt[3] - Log[1 - x^3]

_______________________________________________________________________________________

Maple [A]  time = 0.006, size = 33, normalized size = 1.1 \[ -\ln \left ({x}^{2}+x+1 \right ) +{\frac{2\,\sqrt{3}}{3}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-\ln \left ( -1+x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((3*x^2-x+1)/(-x^3+1),x)

[Out]

-ln(x^2+x+1)+2/3*arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)-ln(-1+x)

_______________________________________________________________________________________

Maxima [A]  time = 1.51984, size = 43, normalized size = 1.43 \[ \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) - \log \left (x^{2} + x + 1\right ) - \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-(3*x^2 - x + 1)/(x^3 - 1),x, algorithm="maxima")

[Out]

2/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*x + 1)) - log(x^2 + x + 1) - log(x - 1)

_______________________________________________________________________________________

Fricas [A]  time = 0.227213, size = 51, normalized size = 1.7 \[ -\frac{1}{3} \, \sqrt{3}{\left (\sqrt{3} \log \left (x^{2} + x + 1\right ) + \sqrt{3} \log \left (x - 1\right ) - 2 \, \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-(3*x^2 - x + 1)/(x^3 - 1),x, algorithm="fricas")

[Out]

-1/3*sqrt(3)*(sqrt(3)*log(x^2 + x + 1) + sqrt(3)*log(x - 1) - 2*arctan(1/3*sqrt(
3)*(2*x + 1)))

_______________________________________________________________________________________

Sympy [A]  time = 0.146447, size = 5, normalized size = 0.17 \[ - \log{\left (x - 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((3*x**2-x+1)/(-x**3+1),x)

[Out]

-log(x - 1)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.217373, size = 45, normalized size = 1.5 \[ \frac{2}{3} \, \sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) -{\rm ln}\left (x^{2} + x + 1\right ) -{\rm ln}\left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-(3*x^2 - x + 1)/(x^3 - 1),x, algorithm="giac")

[Out]

2/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*x + 1)) - ln(x^2 + x + 1) - ln(abs(x - 1))